import java.util.Scanner;

public class Leetcode_9 {
    public static void main(String[] args) {
        System.out.println("请输入有多少个台阶：");
        Scanner S = new Scanner(System.in);
        int n = S.nextInt();
        if(n == 1){
            System.out.println("1");
        }
        int[] dp = new int[n + 1];
        dp[1] = 1;
        dp[2] = 2;
        for(int i = 3; i <= n; i++){
            dp[i] = dp[i-1] + dp[i - 2];
        }
        System.out.println("一次上一阶台阶或者一次上两阶台阶共有："+dp[n]+"种方法");
    }
}
